using NodeCanvas.Variables;
using UnityEngine;

namespace NodeCanvas.Conditions
{
	[Category("GameObject")]
	[AgentType(typeof(Transform))]
	public class IsInFront : ConditionTask
	{
		[RequiredField]
		public BBGameObject CheckTarget;

		[SliderField(1f, 180f)]
		public float AngleToCheck = 70f;

		protected override string info
		{
			get
			{
				return string.Concat(CheckTarget, " in front");
			}
		}

		protected override bool OnCheck()
		{
			return Vector3.Angle(CheckTarget.value.transform.position - base.agent.transform.position, base.agent.transform.forward) < AngleToCheck;
		}
	}
}
